<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h1>Vue 指令 v-for</h1>
      <!-- 
        v-for="(item,index) in 数组"
        item 循环项
        index 索引
      -->
      <ul>
        <li v-for="(item,index) in foods">{{ item }}-----{{ index }}</li>
      </ul>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
      const app = new Vue({
        // 容器
        el: "#app",
        // 数据
        data: {
          foods:[
            '鸡蛋灌饼',
            '煎饼果子',
            '煲仔饭',
            '猪脚饭',
            '豆汁'
          ]
        },
        // 事件处理函数
        methods: {},
      });
    </script>
  </body>
</html>
